package com.example.xunwuproject.service.house;

import com.example.xunwuproject.base.HouseSubscribeStatus;
import com.example.xunwuproject.service.ServiceMultiResult;
import com.example.xunwuproject.service.ServiceResult;
import com.example.xunwuproject.web.dto.HouseDTO;
import com.example.xunwuproject.web.dto.HouseSubscribeDTO;
import com.example.xunwuproject.web.form.DatatableSearch;
import com.example.xunwuproject.web.form.HouseForm;
import com.example.xunwuproject.web.form.RentSearch;
import org.springframework.data.util.Pair;

import java.util.Date;

/**
 * @author ：Anitaxiaofeng
 * @description：
 * @create 2019-03-11
 **/
public interface IHouseService {

    ServiceResult<HouseDTO> save(HouseForm houseForm);

    ServiceMultiResult<HouseDTO> adminQuery(DatatableSearch searchBody);
    ServiceResult update(HouseForm houseForm);

    /**
     * 查询完整房源信息
     * @param id
     * @return
     */
    ServiceResult<HouseDTO> findCompleteOne(Long id);

    ServiceResult removePhoto(Long id);

    ServiceResult updateCover(Long coverId, Long targetId);

    ServiceResult addTag(Long houseId, String tag);

    ServiceResult removeTag(Long houseId, String tag);

    ServiceResult updateStatus(Long id, int value);

    ServiceMultiResult<HouseDTO> query(RentSearch rentSearch);

    ServiceResult addSubscribeOrder(Long houseId);

    ServiceResult subscribe(Long houseId, Date orderTime, String telephone, String desc);

    ServiceResult cancelSubscribe(Long houseId);

    ServiceMultiResult<Pair<HouseDTO,HouseSubscribeDTO>> querySubscribeList(HouseSubscribeStatus of, int start, int size);

    ServiceMultiResult<Pair<HouseDTO,HouseSubscribeDTO>> findSubscribeList(int start, int size);

    ServiceResult finishSubscribe(Long houseId);
}
